All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.display.GroupDrawable

java.lang.Object
   |
   +----quicktime.app.spaces.SimpleSpace
           |
           +----quicktime.app.display.GroupDrawable

public abstract class GroupDrawable
extends SimpleSpace
implements QTDisplaySpace
This forms the base class for grouping QTDrawable objects within a single display space that is controlled by this group.

QTDrawable are drawn in their layer order (Short.minimum value is frontmost, Short.maximum value is furthest back). You can change a position or size of a member by interacting directly with the QTDrawable member itself but you must notify the group of any changes in the display characteristics of the QTDrawable by calling memberChanged().

QTDrawable members can also be positioned within a GroupDrawable using alignment values. An alignment of 0 will place the member at the top and/or left position. An alignment value of 1 will place the member so that it's bottom and/or right is aligned with the bottom of the GroupDrawable's display space.

To reset the layer of an object you use the QTDrawable's Layerable object. QTDrawable objects do not contain any sense of layering, so the GroupDrawable uses the GroupMember objects to contain the information about a member's layer characteristics.

See Also:
DirectGroup

Variable Index

 o clip
The current clip region of the group
 o vec
THis vector is used to store the members in.

Constructor Index

 o GroupDrawable(Dimension, QDColor, int, int, Protocol)
Provided for subclasses to create a group drawable.

Method Index

 o addMember(Object, int)
Adds a member to the QTDisplaySpace at the specified layer.
 o getBackgroundClip()
This method returns the clip that contains any space within the GroupDrawable that is not drawn upon by one of the members.
 o getBackgroundColor()
Returns the current background colour or null if no background colour.
 o getBackLayer()
Returns the back most layer of any object in the group.
 o getClip()
This method allows you to get the current clipped Region of the Transformable.
 o getDisplayBounds()
This method is called automatically via the QTCanvas object associated with this client to set the boundary of the movie.
 o getFrontLayer()
Returns the current front most layer of any object in the group.
 o getGroupMember(Object)
Returns a GroupMember that contains the specified QTDrawable object or null if the requested item is not a member of this group.
 o getGWorld()
QTCanvas calls this method to get the destination QDGraphics of its client.
 o getInitialSize()
This method returns the original size before the transformations specified in the returned matrix are applied.
 o getLayerable(Object)
Returns the Layerable object for a member (or null if the Object is not a member) that allows the application to get and set the layer of a member.
 o getMatrix()
This will return the client's current display transformations.
 o getTransformable(Object)
Returns the Transformable object that represents the member in the DisplaySpace.
 o hitTest(int, int)
Returns the front most object located at the specified x and y pixel location or null if there is no object at the location
 o isEmpty()
Returns true if the space does not have any members.
 o memberChanged(QTDrawable)
This tells the group that the position or display size of the drawer has changed and it should do whatever actions are appropriate to reestablish the display integrity of the group.
 o members()
Returns an iterator of QTDrawable members that are the items that are currently contained within the DirectGroup.
 o redraw(Region)
QTCanvas calls this method when the client should redraw itself.
 o redrawMember(QTDrawable, Region)
An optimized redraw that will redraw only those objects that it needs to based on the fact that the supplied drawer has changed but those behind or in front of it have not.
 o removeMember(Object)
Remove a QTDrawable object from the Group of drawn items.
 o setAlignedMemberLocation(QTDrawable, float, float)
A helper method that is used to set the location of the member based on the x and y alignment.
 o setBackgroundColor(QDColor)
Sets the background color.
 o setClip(Region)
This method allows you to set a Transformable's clipping region.
 o setDisplayBounds(QDRect)
This method is called automatically via the QTCanvas object associated with this client to set its boundary.
 o setGWorld(QDGraphics)
QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing.
 o setLocation(int, int)
A convenience method to set the position of a QTDrawable object.
 o setMatrix(Matrix)
This method sets the current matrix of the Transformable object to the new matrix.
 o setMemberAlignment(QTDrawable, float, float)
This will reset an item's alignment and redraw the group.
 o setMemberLayer(QTDrawable, int)
This sets the layer of the incoming drawable to the new layer.
 o size()
Returns the number of members in the collection, ie.

Variables

 o clip
 protected Region clip
The current clip region of the group

 o vec
 protected Vector vec
THis vector is used to store the members in. It is kept sorted by layer with the frontmost member in the first slot of the vector.

Constructors

 o GroupDrawable
 protected GroupDrawable(Dimension initialSize,
                         QDColor bc,
                         int scale,
                         int period,
                         Protocol p) throws QTException
Provided for subclasses to create a group drawable.

Parameters:
initialSize - initial size of the Drawable object
bc - the background color
scale - the scale of the Space's Timer
period - the period of the Space's Timer.
p - the Protocol that is enforced on candidate member objects of this group

Methods

 o getGWorld
 public QDGraphics getGWorld() throws StdQTException
QTCanvas calls this method to get the destination QDGraphics of its client.

Returns:
a QDGraphics object or null
 o setGWorld
 public void setGWorld(QDGraphics cgp) throws QTException
QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing. If the incoming QDGraphics is the QDGraphics.scratch then the drawable will not be visible and can disable itself. If a client is unable to set the graphics world it should throw an exception.

Parameters:
cgp - a QDGraphics object
 o setLocation
 public void setLocation(int x,
                         int y) throws QTException
A convenience method to set the position of a QTDrawable object.

Parameters:
x - the new x location
y - the new y location
 o setDisplayBounds
 public void setDisplayBounds(QDRect bounds) throws QTException
This method is called automatically via the QTCanvas object associated with this client to set its boundary.

Parameters:
bounds - a QDRect object describing the boundary
 o getDisplayBounds
 public QDRect getDisplayBounds() throws StdQTException
This method is called automatically via the QTCanvas object associated with this client to set the boundary of the movie.

Parameters:
bounds - a QDRect object describing the boundary
 o getBackgroundColor
 public QDColor getBackgroundColor()
Returns the current background colour or null if no background colour.

 o setBackgroundColor
 public void setBackgroundColor(QDColor col) throws QTException
Sets the background color. This will force a redraw of the Compositor.

 o removeMember
 public synchronized void removeMember(Object member) throws QTException
Remove a QTDrawable object from the Group of drawn items.

Parameters:
QTDrawable - drawer the item to remove
Overrides:
removeMember in class SimpleSpace
 o members
 public synchronized Enumeration members()
Returns an iterator of QTDrawable members that are the items that are currently contained within the DirectGroup.

Returns:
an Enumeration
Overrides:
members in class SimpleSpace
 o isEmpty
 public boolean isEmpty()
Returns true if the space does not have any members.

Returns:
a boolean
Overrides:
isEmpty in class SimpleSpace
 o getGroupMember
 public GroupMember getGroupMember(Object member)
Returns a GroupMember that contains the specified QTDrawable object or null if the requested item is not a member of this group.

Parameters:
drawer - the QTDrawable object to search for.
Returns:
a GroupMember that contains the layer and alignment information for the member in this group
 o size
 public int size()
Returns the number of members in the collection, ie. the collection's size.

Returns:
the size of the collection.
Overrides:
size in class SimpleSpace
 o memberChanged
 public abstract GroupMember memberChanged(QTDrawable d) throws QTException
This tells the group that the position or display size of the drawer has changed and it should do whatever actions are appropriate to reestablish the display integrity of the group. If the drawer is not a member of the group then null should be returned, if it is a member then a GroupMember object is returned that contains the layout characteristics of the drawer.

Parameters:
d - the drawer that has changed
Returns:
the GroupMember object that is associated with that drawer.
 o redrawMember
 public abstract void redrawMember(QTDrawable d,
                                   Region invalidRgn) throws QTException
An optimized redraw that will redraw only those objects that it needs to based on the fact that the supplied drawer has changed but those behind or in front of it have not.

Parameters:
d - the member of which some display characteristic has changed.
invalidRgn - the Region that has changed as a result of the changes in the specified member. Generally this Region should encompass the area of the Group's display space that was occupied before the member was changed as this call will result in the member itself being redrawn.
 o setMemberAlignment
 public boolean setMemberAlignment(QTDrawable d,
                                   float xAlign,
                                   float yAlign) throws QTException
This will reset an item's alignment and redraw the group. Internally the group uses alignment values to recall where an item is in relation to the other members and the group's display space. Upon resize of the group's display space items are layed out in accordance of their alignment settings.

Parameters:
d - the drawer to reposition the alignment
xAlign - the new x alignment value for the member
yAlign - the new y alignemen value for the member
Returns:
true if the drawer is a member of the group
 o setMemberLayer
 public boolean setMemberLayer(QTDrawable member,
                               int layer) throws QTException
This sets the layer of the incoming drawable to the new layer. It returns true if the drawable is a member of the group and was reset, false otherwise.

Parameters:
d - the group member to reset
layer - the new layer
Returns:
true if d is a member of the group
 o getBackLayer
 public int getBackLayer()
Returns the back most layer of any object in the group.

Returns:
the current back most layer
 o getFrontLayer
 public int getFrontLayer()
Returns the current front most layer of any object in the group.

Returns:
the current front most layer
 o getInitialSize
 public Dimension getInitialSize() throws QTException
This method returns the original size before the transformations specified in the returned matrix are applied.

 o redraw
 public synchronized void redraw(Region invalidRgn) throws QTException
QTCanvas calls this method when the client should redraw itself. If the canvas is able to discern that only a part of the client's drawing area needs to be redrawn - then this area shall be passed in using the invalidRgn. Otherwise this will be null in which case the client should redraw itself entirely.

Parameters:
canv - the QTCanvas that is doing the drawing
invalidRgn - the invalidRgn that the client should redraw
 o getLayerable
 public Layerable getLayerable(Object member)
Returns the Layerable object for a member (or null if the Object is not a member) that allows the application to get and set the layer of a member. This may or may not be the member itself, depending both on the type of the object of the member and the manner in which the QTDisplaySpace handles the Layer property of its members.

Parameters:
member - the member
Returns:
a Layerable object to interact with the display layer of a member.
 o getTransformable
 public Transformable getTransformable(Object member)
Returns the Transformable object that represents the member in the DisplaySpace. The Transformable object allows the application to get and set the TwoD display characteristics of a member (position, size, rotation, skewing, perspective). If the Object is not a member of the Space this returns null. This may or may not return the member itself, based on the type of the member and how the Space deals with the two dimensional placement and display of its members.

Parameters:
member - the member of Space for which the Transformable object should be returned.
Returns:
a Transformable object that allows the application to manipulate the two d display characteristics of the member or null if the object is not a member.
 o hitTest
 public QTDrawable hitTest(int x,
                           int y) throws QTException
Returns the front most object located at the specified x and y pixel location or null if there is no object at the location

Parameters:
x - the x pixel to test
y - the y pixel to test
Returns:
front most object or null
 o getMatrix
 public Matrix getMatrix() throws StdQTException
This will return the client's current display transformations. A GroupDrawable object does not by default support any transformation but location.

Returns:
the display transformations of the client
 o setMatrix
 public void setMatrix(Matrix matrix) throws QTException
This method sets the current matrix of the Transformable object to the new matrix. A GroupDrawable object does not by default support any transformation but location.

Parameters:
matrix - the new location
 o getClip
 public Region getClip() throws QTException
This method allows you to get the current clipped Region of the Transformable.

Returns:
the clipping region
 o getBackgroundClip
 public Region getBackgroundClip()
This method returns the clip that contains any space within the GroupDrawable that is not drawn upon by one of the members. This region is contains the pixels that will be filled in with the background colour.

Returns:
the background region.
 o setClip
 public abstract void setClip(Region theClip) throws QTException
This method allows you to set a Transformable's clipping region.

Parameters:
theClip - a Region that defines the new clipping region.
 o setAlignedMemberLocation
 protected void setAlignedMemberLocation(QTDrawable drawer,
                                         float xAlign,
                                         float yAlign) throws QTException
A helper method that is used to set the location of the member based on the x and y alignment. The alignment values must be between 0 and 1.

Parameters:
drawer - The drawer to locate based on the current size of the GroupDrawable and the alignment values
xAlign - the x alignment
yAlign - the y alignment

All Packages  Class Hierarchy  This Package  Previous  Next  Index